package 接口多态综合案例;

public class Test {
    public static void main(String[] args) {
        Computer mac = new Computer();
        USB mx2 = new Mouse();
        USB k375s = new Keyboard();
        mac.poweron();
        mac.useUsb(mx2);
        mac.useUsb(k375s);

        Keyboard k380 = new Keyboard();
        //向上转型
        mac.useUsb(k380);

        //匿名对象
        mac.useUsb(new Keyboard());

        mac.poweroff();
    }
}
